<?php
namespace app\index\model;
use think\Model;
class Deal extends Model
{
    public function add($datas) {
        $datas['pay_status'] = 0;
        $this->save($datas);
        return $this->id;

    }
     
    public function updatePay($outTradeNo, $weixindata) {
        if(!empty($weixindata['transaction_id'])) {
            $data['transaction_id'] = $weixindata['transaction_id'];
            $data['pay_status'] = 1;
        }
        return $this->allowField(true)
            ->save($data, ['trade_no' =>$outTradeNo]);
    }


}